import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import './index.scss'
//新增收获地址页面
import { AtForm, AtInput, AtButton   } from 'taro-ui'
export default class Index extends Component {

  config = {
    navigationBarTitleText: '新增收货地址',
    navigationBarBackgroundColor: '#6381F7',
    // navigationBarTitleText: 'WeChat',
    navigationBarTextStyle: 'white'
  }

  constructor(props) {
    super(props)
    this.state = {
      value: '',
      juli: true,
      current: 0,
      isOpened: false,
      AtInputNumbervalue: 1,
      checkedList: ['list1']
    }

  }

  handleChange (value) {
    this.setState({
      value1:value
    })
  }
  onSubmit (event) {
    console.log(event,1)
    Taro.navigateTo({
      url: '../index.2/index'
    })
  }

  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }






  render() {

    var height
    wx.getSystemInfo({
      success: function (res) {
        console.log(res)
        height = res.screenHeight - 130 + 'px'
      }
    })
    return (
      <AtForm
        onSubmit={this.onSubmit.bind(this)}
     
      >
        <AtInput
          name='value'
          title='联系人:'
          type='text'
          placeholder='请填写收货人姓名'
          value={this.state.value1}
          onChange={this.handleChange.bind(this)}
        />
         <AtInput
          name='value1'
          title='手机号:'
          type='text'
          placeholder='请填写收货手机号码'
          value={this.state.value2}
          onChange={this.handleChange.bind(this)}
        />
         <AtInput
          name='value2'
          title='地区:'
          type='text'
          placeholder='请选择收货地址'
          value={this.state.value3}
          onChange={this.handleChange.bind(this)}
        />
         <AtInput
          name='value3'
          title='详细地址:'
          type='text'
          placeholder='如16栋1702室'
          value={this.state.value4}
          onChange={this.handleChange.bind(this)}
        />
        <AtButton formType='submit' type='primary'>保存并使用</AtButton>
        
      </AtForm>
    )
  }
}

